import Cookies from 'js-cookie'

const tokenKey = 'Admin-token'

const ExpiresInKey = 'Admin-Expires-In'

export function gettoken() {
  return Cookies.get(tokenKey)
}

export function settoken(token) {
  return Cookies.set(tokenKey, token)
}

export function removetoken() {
  return Cookies.remove(tokenKey)
}

export function getExpiresIn() {
  return Cookies.get(ExpiresInKey) || -1
}

export function setExpiresIn(time) {
  return Cookies.set(ExpiresInKey, time)
}

export function removeExpiresIn() {
  return Cookies.remove(ExpiresInKey)
}
